import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import '@/icons' // icon
//路由守卫
import '@/permission' // permission control
//引入自定义指令
// import '@/directives'
//引入所有信息 directives就是个对象现在 
import * as directives from '@/directives'
//批量注册自定义指令
Object.keys(directives).forEach(key => { //key是每一项的属性名 directives[key]是值 遍历每一项 批量注册指令
    Vue.directive(key, directives[key])
})

// set ElementUI lang to EN
Vue.use(ElementUI, { locale })
    // 如果想要中文版 element-ui，按如下方式声明
    // Vue.use(ElementUI)

Vue.config.productionTip = false;
//process表示进程   //process.env表示进程里的环境变量
console.log(process);
console.log(process.env);
//可以通过process.env.NODE_ENV来判断属于什么开发环境   development/production
console.log(process.env.NODE_ENV);
console.log('VUE_APP_DESC', process.env.VUE_APP_DESC);


new Vue({
    el: '#app',
    router,
    store,
    render: h => h(App)
})